import HTTP from '@/utils/request.js'
// 登录
export const Login = (data) => {
	return HTTP.post({
		url: '/api/user/mobilelogin',
		data
	})
}
// 获取验证码
export const Sendcode = (data) => {
	return HTTP.post({
		url: '/api/sms/send',
		data
	})
}
// 注册
export const register = (data) => {
	return HTTP.post({
		url: '/api/user/register',
		data
	})
}
// 获取首页banner
export const getAdsById = (data) => {
	return HTTP.get({
		url: '/api/adszone/getAdsById?id='+data,
	})
}
// 供需列表
export const gethomesad = () => {
	return HTTP.get({
		url: '/api/sad/gethomesad',
	})
}
// 服务列表
export const getservicelist = (category_id) => {
	return HTTP.post(
		{
			url: '/api/services/getservicelist',
			data: {category_id},
		})
}
// 获取导航
export const getnavi = () => {
	return HTTP.get({
		url: '/api/home/getnavi',
	})
}
// 个人中心
export const getuserinfo = () => {
	return HTTP.get({
		url: '/api/account/getuserinfo',
	})
}
// 修改用户信息
export const saveuserinfo = (data) => {
	return HTTP.post({
		url: '/api/account/saveuserinfo',
		data
	})
}

// 服务详情
export const getservicedetail = (id) => {
	return HTTP.post(
		{
			url: '/api/services/getservicedetail',
			data: {id},
		})
}

export const getcategory = (pid) => {
	return HTTP.post(
		{
			url: '/api/category/getcategory',
			data: {pid},
		})
}